package br.com.beautycenter.view;

import br.com.beautycenter.Funcionalidades.Data;
import br.com.beautycenter.Funcionalidades.Swing;
import br.com.beautycenter.Funcionalidades.Validacoes;
import br.com.beautycenter.DAO.PersisteFuncionario;
import br.com.beautycenter.DAO.PersistePerfilAntropometrico;
import br.com.beautycenter.bean.Funcionario;
import br.com.beautycenter.bean.Cliente;
import br.com.beautycenter.bean.PerfilAntropometrico;
import java.awt.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import org.joda.time.DateTime;

public class CadastroPerfilAntropometrico extends javax.swing.JDialog {

    CadastroCliente cadastroPaciente;
    PersistePerfilAntropometrico persistePerfil = new PersistePerfilAntropometrico();
    PersisteFuncionario persisteFuncionario = new PersisteFuncionario();
    
    List<PerfilAntropometrico> listaPerfis = new ArrayList<PerfilAntropometrico>();
    int operacao = -1;
    int posicao = -1;
    
    PerfilAntropometrico perfil = new PerfilAntropometrico();
    Cliente cliente;
    Funcionario funcionario = new Funcionario();

    
    public void inserirFuncionario(){
        funcionario = new Funcionario();
        funcionario.setNome(txtNutricionista.getText().trim());
        
        funcionario = persisteFuncionario.retornarFuncionarioPeloNome(funcionario).get(0);
    }
    
    /**
     * Inicialmente os botões ativos serão: <br/> btnNovo<br/> btnEditar<br/>
     * btnPesquisar<br/> btnSair<br/>
     */
    public void ativarBotoesIniciar() {
        Swing.desativarCampos(jPainelBotoes.getComponents());

        //se a lista estiver vazia, cria um novo
        if (listaPerfis.isEmpty()) {
            novo();
            btnCancelar.setEnabled(false);
        } else if (posicao < 0) {
            btnNovo.setEnabled(true);
            btnPesquisar.setEnabled(true);
            btnSair.setEnabled(true);
        } else {
            btnNovo.setEnabled(true);
            btnPesquisar.setEnabled(true);
            btnSair.setEnabled(true);
            btnEditar.setEnabled(true);
            btnExcluir.setEnabled(true);
        }
    }

    /**
     * Quanto clicar em Novo ou Editar ativará os botões: <br/> btnSalvar<br/>
     * btnCancelar<br/> btnSair<br/>
     */
    public void ativarBotoesNovoEditarExcluir() {
        Swing.desativarCampos(jPainelBotoes.getComponents());
        btnSalvar.setEnabled(true);
        btnCancelar.setEnabled(true);
        btnSair.setEnabled(true);
    }

    public void limparCampos() {
        jDateConsulta.setDate(new Date());
        Swing.zerarCampos(jPanelPeso.getComponents());
        Swing.zerarCampos(jPanelAltura.getComponents());
        Swing.zerarCampos(jPanelDiametros.getComponents());
        Swing.zerarCampos(jPanelDobrasCutaneas.getComponents());
        Swing.zerarCampos(jPanelPerimetros.getComponents());
        Swing.zerarCampos(jPanelBioimpedancia.getComponents());
    }

    public void desativarCampos() {
        Swing.desativarCampos(jPanelDados.getComponents());
        Swing.desativarCampos(jPanelPeso.getComponents());
        Swing.desativarCampos(jPanelAltura.getComponents());
        Swing.desativarCampos(jPanelDiametros.getComponents());
        Swing.desativarCampos(jPanelDobrasCutaneas.getComponents());
        Swing.desativarCampos(jPanelPerimetros.getComponents());
        Swing.desativarCampos(jPanelBioimpedancia.getComponents());
    }

    public void ativarCampos() {
        Swing.ativarCampos(jPanelDados.getComponents());
        Swing.ativarCampos(jPanelPeso.getComponents());
        Swing.ativarCampos(jPanelAltura.getComponents());
        Swing.ativarCampos(jPanelDiametros.getComponents());
        Swing.ativarCampos(jPanelDobrasCutaneas.getComponents());
        Swing.ativarCampos(jPanelPerimetros.getComponents());
        Swing.ativarCampos(jPanelBioimpedancia.getComponents());
        
        txtNutricionista.setEnabled(false);
        txtCrn.setEnabled(false);
        txtPaciente.setEnabled(false);
        txtIdade.setEnabled(false);
    }

    public void inicializarTela() {
        cliente = DadosCliente.cliente;
        listaPerfis = cliente.getListaPerfisAntropometricos();
        
        
        limparCampos();
        txtNutricionista.setText(cliente.getMedicoResponsavel());
        txtCrn.setText("");
        txtPaciente.setText(cliente.getNome());
        
        DateTime aniversario = null;
        if(cliente.getDtNascimento() != null){
            aniversario = new DateTime(cliente.getDtNascimento().getTime());
        }
        txtIdade.setText(Data.retornarIdade(aniversario));
        jDateConsulta.setDate(new Date());
        desativarCampos();
        ativarBotoesIniciar();
        
        inserirFuncionario();
    }

    public void novo() {
        operacao = 0;
        limparCampos(); //limpa os dados
        ativarCampos();//ativa os campos
        ativarBotoesNovoEditarExcluir();

        //cria um novo funcionário
        //OBS: é ideia colocar o idPessoa(0), pois caso cadastrar mais de um usuário na mesma sessão, não vai da pau.
        perfil = new PerfilAntropometrico();
        perfil.setIdPerfilAntropometrico(0);

        txtAtual.requestFocus();
    }

    /**
     * Deixa a tela preparada para a atualização de um funcionário
     */
    public void editar() {
        operacao = 1;
        exibirPerfil();
        ativarCampos();
        ativarBotoesNovoEditarExcluir();

        perfil = new PerfilAntropometrico();
        perfil = listaPerfis.get(posicao);

        txtAtual.requestFocus();
    }

    /**
     * Trava a tela e exibe o paciente que estava antes
     */
    public void cancelar() {
        ativarBotoesIniciar();
        if (posicao < 0) {
            limparCampos();
        } else {
            exibirPerfil();
        }

        desativarCampos();
    }
    
    public void salvar(){
        if(validarFormulario()){
            operacao = -1;
            limparCampos();
            desativarCampos();
            ativarBotoesIniciar();
        }
    }
    
    
    /**
     * `Remove o perfil da lista e atualiza o paciente.
     */
    public void excluir(){
        perfil = listaPerfis.get(posicao);
        perfil = persistePerfil.retornarPerfilPeloId(perfil);
        try{
            persistePerfil.deletar(perfil);
            listaPerfis.remove(posicao);
        }catch(Exception ex){
            System.out.println("ex: " + ex.getMessage());
            ex.printStackTrace();
        }
        
        posicao = -1;
        limparCampos();
        desativarCampos();
        ativarBotoesIniciar();
    }

    public void exibirPerfil() {
        jDateConsulta.setDate(listaPerfis.get(posicao).getDtCadastro());

        txtAtual.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPesoAtual()));
        txtDesejado.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPesoDesejado()));
        txtHabitual.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPesoHabitual()));

        txtAltura.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getAlturaTotal()));
        txtAlturaJoelho.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getAlturaJoelho()));

        txtDiametrosBiestiloide.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getDiametroBiestiloide()));
        txtDiametrosBUmeral.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getDiametroBUmeral()));
        txtDiametrosBFemural.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getDiametroBFemural()));

        txtDobrasTriceps.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getDobrasTriceps()));
        txtDobrasSupraEspinal.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getDobrasSupraEspinal()));
        txtDobrasPanturrilha.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getDobrasPanturrilha()));
        txtDobrasSubescapular.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getDobrasSubescapular()));
        txtDobrasBiceps.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getDobrasBiceps()));
        txtDobrasCoxa.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getDobrasCoxa()));
        txtDobrasSupraIliaca.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getDobrasSupraIliaca()));
        txtDobrasAxiliarMedial.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getDobrasAxilarMedial()));
        txtDobrasAbdome.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getDobrasAbdome()));
        txtDobrasToracica.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getDobrasToracica()));

        txtPerimetroPunho.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPerimetroPunho()));
        txtPerimetroGluteoMax.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPerimetroGluteoMax()));
        txtPerimetroCoxaMax.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPerimetroCoxaMax()));
        txtPerimetroBraco.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPerimetroBraco()));
        txtPerimetroAbdominal.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPerimetroAbdominal()));
        txtPerimetroPanturrilha.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPerimetroPanturrilha()));
        txtPerimetroCintura.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPerimetroCintura()));
        txtPerimetroTorax.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPerimetroTorax()));
        txtPerimetroTornozelo.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPerimetroTornozelo()));
        txtPerimetroQuadril.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPerimetroQuadril()));
        txtPerimetroAntebraco.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getPerimetroAntebraco()));

        txtBioPercentualGordura.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getBioPercentualGordura()));
        txtBioPesoMagro.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getBioPesoMagro()));
        txtBioPesoGordo.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getBioPesoGordo()));
        txtBioPesoMuscular.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getBioPesoMuscular()));
        txtBioTotalAgua.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getBioTotalAgua()));
        txtBioValorEnergeticoTotal.setText(Validacoes.formatoMoeda.format(listaPerfis.get(posicao).getBioValorEnergeticoTotal()));

    }

    public boolean validarDataConsulta() {
        if (Validacoes.validarData(jDateConsulta.getDate(), true)) {
            perfil.setDtCadastro(jDateConsulta.getDate());
            return true;
        } else {
            JOptionPane.showMessageDialog(null, "Preencha o campo data corretamente. Ele não pode estar vazio ou ser maior que a "
                    + "data atual.");
            jDateConsulta.requestFocus();
            return false;
        }
    }

    /**
     * Percorre os campos verificando se o valor informado é válido ou não
     *
     * @return
     */
    public boolean validarPeso() {
        List<Double> lista = new ArrayList<Double>();
        Double valor;
        for (Component item : jPanelPeso.getComponents()) {
            if (item instanceof JTextField) {
                JTextField aux = (JTextField) item;
                valor = Validacoes.validarCampoMoeda(aux.getText().trim().replace(".", ","));
                if (valor == null) {
                    JOptionPane.showMessageDialog(null, "Peso informado é inválido.");
                    item.requestFocus();
                    return false;
                }
                lista.add(valor);
            }
        }

        perfil.setPesoAtual(lista.get(0));
        perfil.setPesoDesejado(lista.get(1));
        perfil.setPesoHabitual(lista.get(2));
        return true;
    }

    public boolean validarAltura() {
        List<Double> lista = new ArrayList<Double>();
        Double valor;
        for (Component item : jPanelAltura.getComponents()) {
            if (item instanceof JTextField) {
                JTextField aux = (JTextField) item;
                valor = Validacoes.validarCampoMoeda(aux.getText().trim().replace(".", ","));
                if (valor == null) {
                    JOptionPane.showMessageDialog(null, "Altura informada é inválida.");
                    item.requestFocus();
                    return false;
                }
                lista.add(valor);
            }
        }

        perfil.setAlturaTotal(lista.get(1));
        perfil.setAlturaJoelho(lista.get(0));
        return true;
    }

    public boolean validarDiametros() {
        List<Double> lista = new ArrayList<Double>();
        Double valor;
        for (Component item : jPanelDiametros.getComponents()) {
            if (item instanceof JTextField) {
                JTextField aux = (JTextField) item;
                valor = Validacoes.validarCampoMoeda(aux.getText().trim().replace(".", ","));
                if (valor == null) {
                    JOptionPane.showMessageDialog(null, "Diâmetro informado é inválido.");
                    item.requestFocus();
                    return false;
                }
                lista.add(valor);
            }
        }

        perfil.setDiametroBiestiloide(lista.get(0));
        perfil.setDiametroBUmeral(lista.get(1));
        perfil.setDiametroBFemural(lista.get(2));
        return true;
    }

    public boolean validarDobras() {
        List<Double> lista = new ArrayList<Double>();
        Double valor;
        for (Component item : jPanelDobrasCutaneas.getComponents()) {
            if (item instanceof JTextField) {
                JTextField aux = (JTextField) item;
                valor = Validacoes.validarCampoMoeda(aux.getText().trim().replace(".", ","));
                if (valor == null) {
                    JOptionPane.showMessageDialog(null, "Dobra cultânea informada é inválida.");
                    item.requestFocus();
                    return false;
                }
                lista.add(valor);
            }
        }

        perfil.setDobrasTriceps(lista.get(0));
        perfil.setDobrasSupraEspinal(lista.get(1));
        perfil.setDobrasPanturrilha(lista.get(2));
        perfil.setDobrasSubescapular(lista.get(3));
        perfil.setDobrasBiceps(lista.get(4));
        perfil.setDobrasCoxa(lista.get(5));
        perfil.setDobrasSupraIliaca(lista.get(6));
        perfil.setDobrasAxilarMedial(lista.get(7));
        perfil.setDobrasAbdome(lista.get(8));
        perfil.setDobrasToracica(lista.get(9));

        return true;
    }

    public boolean validarPerimetros() {
        List<Double> lista = new ArrayList<Double>();
        Double valor;
        for (Component item : jPanelPerimetros.getComponents()) {
            if (item instanceof JTextField) {
                JTextField aux = (JTextField) item;
                valor = Validacoes.validarCampoMoeda(aux.getText().trim().replace(".", ","));
                if (valor == null) {
                    JOptionPane.showMessageDialog(null, "Perímetro informado é inválido.");
                    item.requestFocus();
                    return false;
                }
                lista.add(valor);
            }
        }

        perfil.setPerimetroPunho(lista.get(0));
        perfil.setPerimetroGluteoMax(lista.get(1));
        perfil.setPerimetroCoxaMax(lista.get(2));
        perfil.setPerimetroBraco(lista.get(3));
        perfil.setPerimetroAbdominal(lista.get(4));
        perfil.setPerimetroPanturrilha(lista.get(5));
        perfil.setPerimetroCintura(lista.get(6));
        perfil.setPerimetroTorax(lista.get(7));
        perfil.setPerimetroTornozelo(lista.get(8));
        perfil.setPerimetroQuadril(lista.get(9));
        perfil.setPerimetroAntebraco(lista.get(10));

        return true;
    }

    public boolean validarBioImpedancia() {
        List<Double> lista = new ArrayList<Double>();
        Double valor;
        for (Component item : jPanelBioimpedancia.getComponents()) {
            if (item instanceof JTextField) {
                JTextField aux = (JTextField) item;
                valor = Validacoes.validarCampoMoeda(aux.getText().trim().replace(".", ","));
                if (valor == null) {
                    JOptionPane.showMessageDialog(null, "Bioimpedância informada é inválida.");
                    item.requestFocus();
                    return false;
                }
                lista.add(valor);
            }
        }

        perfil.setBioPercentualGordura(lista.get(0));
        perfil.setBioPesoMagro(lista.get(1));
        perfil.setBioPesoGordo(lista.get(2));
        perfil.setBioPesoMuscular(lista.get(3));
        perfil.setBioTotalAgua(lista.get(4));
        perfil.setBioValorEnergeticoTotal(lista.get(5));

        return true;
    }
    
    
    public boolean validarFormulario() {
        if(validarDataConsulta() && validarPeso()&& validarAltura() && validarDiametros() && 
                validarDobras() && validarPerimetros() && validarBioImpedancia()){
            //se estiver tudo ok, salva no banco e jogo na lista de perfis contidas em paciente e atualiza o paciente
            
            inserirFuncionario();
            perfil.setFuncionario(funcionario);
            perfil.setPaciente(cliente);
            
            if(operacao == 0){
                persistePerfil.salvar(perfil); 
                listaPerfis.add(perfil);
            }else{
                persistePerfil.atualizar(perfil); 
            }
            return true;
        }
        
        return false;
    }
    
    public void pesquisar(){
        if(!listaPerfis.isEmpty()){
            selecionarPerfil();
            ativarBotoesIniciar();
        }else{
            JOptionPane.showMessageDialog(null, "Não existe um perfil antropométrico cadastrado para esse funcionário.");
        }
    }
    
    /**
     * Cria uma janela de confirmação contendo uma label e um combobox. Nesse combobox ficarão as datas de cadastro dos perfis.
     * O Objetivo e retornar e exibir o perfil procurado
     */
    
    public void selecionarPerfil(){
        JLabel label = new JLabel("Data da consulta:");
        JComboBox combo = new JComboBox();
        Object[] objetos = new Object[]{label, combo};
        
        //preenchendo o combo com os valores da lista
        for(PerfilAntropometrico item: listaPerfis){
            combo.addItem(Data.formatoDataConvencional.format(item.getDtCadastro()));
        }
        
        //exibe a mensagem na tela e pega a resposta
        int resposta = JOptionPane.showConfirmDialog(null, objetos, 
                "Selecione um perfil pela sua data de cadastro", JOptionPane.OK_CANCEL_OPTION);
        
        //se a resposta for ok, retorna o perfil desejado.
        if(resposta == JOptionPane.OK_OPTION){
            posicao = combo.getSelectedIndex();
            exibirPerfil();
            desativarCampos();
        }
    }
    
    /**
     * Creates new form CadastroPerfilAntropometrico1
     */
    public CadastroPerfilAntropometrico(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        inicializarTela();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPainelBotoes = new javax.swing.JPanel();
        btnNovo = new javax.swing.JButton();
        btnEditar = new javax.swing.JButton();
        btnExcluir = new javax.swing.JButton();
        btnPesquisar = new javax.swing.JButton();
        btnSalvar = new javax.swing.JButton();
        btnCancelar = new javax.swing.JButton();
        btnSair = new javax.swing.JButton();
        jPanelDados = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        txtNutricionista = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        txtCrn = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        txtPaciente = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        txtIdade = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jDateConsulta = new com.toedter.calendar.JDateChooser();
        jSeparator6 = new javax.swing.JSeparator();
        jLabel5 = new javax.swing.JLabel();
        jPanelPeso = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        txtAtual = new javax.swing.JTextField();
        txtDesejado = new javax.swing.JTextField();
        txtHabitual = new javax.swing.JTextField();
        jPanelAltura = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        txtAltura = new javax.swing.JTextField();
        txtAlturaJoelho = new javax.swing.JTextField();
        jPanelDiametros = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        txtDiametrosBiestiloide = new javax.swing.JTextField();
        txtDiametrosBUmeral = new javax.swing.JTextField();
        txtDiametrosBFemural = new javax.swing.JTextField();
        jPanelDobrasCutaneas = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        txtDobrasTriceps = new javax.swing.JTextField();
        txtDobrasSupraEspinal = new javax.swing.JTextField();
        txtDobrasPanturrilha = new javax.swing.JTextField();
        txtDobrasSubescapular = new javax.swing.JTextField();
        txtDobrasBiceps = new javax.swing.JTextField();
        txtDobrasCoxa = new javax.swing.JTextField();
        txtDobrasSupraIliaca = new javax.swing.JTextField();
        txtDobrasAxiliarMedial = new javax.swing.JTextField();
        txtDobrasAbdome = new javax.swing.JTextField();
        txtDobrasToracica = new javax.swing.JTextField();
        jPanelPerimetros = new javax.swing.JPanel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        txtPerimetroPunho = new javax.swing.JTextField();
        txtPerimetroGluteoMax = new javax.swing.JTextField();
        txtPerimetroCoxaMax = new javax.swing.JTextField();
        txtPerimetroBraco = new javax.swing.JTextField();
        txtPerimetroAbdominal = new javax.swing.JTextField();
        txtPerimetroPanturrilha = new javax.swing.JTextField();
        txtPerimetroCintura = new javax.swing.JTextField();
        txtPerimetroTorax = new javax.swing.JTextField();
        txtPerimetroTornozelo = new javax.swing.JTextField();
        txtPerimetroQuadril = new javax.swing.JTextField();
        txtPerimetroAntebraco = new javax.swing.JTextField();
        jPanelBioimpedancia = new javax.swing.JPanel();
        jLabel36 = new javax.swing.JLabel();
        BioPesoMagro = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        jLabel41 = new javax.swing.JLabel();
        txtBioPercentualGordura = new javax.swing.JTextField();
        txtBioPesoMagro = new javax.swing.JTextField();
        txtBioPesoGordo = new javax.swing.JTextField();
        txtBioPesoMuscular = new javax.swing.JTextField();
        txtBioTotalAgua = new javax.swing.JTextField();
        txtBioValorEnergeticoTotal = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPainelBotoes.setPreferredSize(new java.awt.Dimension(800, 45));

        btnNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Novo.png"))); // NOI18N
        btnNovo.setToolTipText("NOVO");
        btnNovo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNovoActionPerformed(evt);
            }
        });
        jPainelBotoes.add(btnNovo);

        btnEditar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Editar.png"))); // NOI18N
        btnEditar.setToolTipText("EDITAR");
        btnEditar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditarActionPerformed(evt);
            }
        });
        jPainelBotoes.add(btnEditar);

        btnExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Excluir.png"))); // NOI18N
        btnExcluir.setToolTipText("EXCLUIR");
        btnExcluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExcluirActionPerformed(evt);
            }
        });
        jPainelBotoes.add(btnExcluir);

        btnPesquisar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Pesquisar.png"))); // NOI18N
        btnPesquisar.setToolTipText("PESQUISAR");
        btnPesquisar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPesquisarActionPerformed(evt);
            }
        });
        jPainelBotoes.add(btnPesquisar);

        btnSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Salvar.png"))); // NOI18N
        btnSalvar.setToolTipText("SALVAR");
        btnSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalvarActionPerformed(evt);
            }
        });
        jPainelBotoes.add(btnSalvar);

        btnCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Cancelar.png"))); // NOI18N
        btnCancelar.setToolTipText("CANCELAR");
        btnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarActionPerformed(evt);
            }
        });
        jPainelBotoes.add(btnCancelar);

        btnSair.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Sair.png"))); // NOI18N
        btnSair.setToolTipText("SAIR");
        btnSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSairActionPerformed(evt);
            }
        });
        jPainelBotoes.add(btnSair);

        jPanelDados.setBackground(new java.awt.Color(255, 255, 255));

        jLabel1.setText("NUTRICIONISTA:");

        txtNutricionista.setEnabled(false);

        jLabel2.setText("CRN:");

        txtCrn.setEnabled(false);

        jLabel3.setText("PACIENTE:");

        txtPaciente.setEnabled(false);

        jLabel4.setText("IDADE:");

        txtIdade.setEnabled(false);

        jLabel6.setText("DATA CONSULTA:");

        jLabel5.setText("PERFIL ANTROPOMÉTRICO");

        jPanelPeso.setBackground(new java.awt.Color(255, 255, 255));
        jPanelPeso.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Peso", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(51, 51, 255)));

        jLabel7.setText("Atual:");

        jLabel8.setText("Desejado:");

        jLabel9.setText("Habitual:");

        txtHabitual.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtHabitualKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtHabitualKeyReleased(evt);
            }
        });

        javax.swing.GroupLayout jPanelPesoLayout = new javax.swing.GroupLayout(jPanelPeso);
        jPanelPeso.setLayout(jPanelPesoLayout);
        jPanelPesoLayout.setHorizontalGroup(
            jPanelPesoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPesoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelPesoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPesoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtAtual, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDesejado, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtHabitual, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanelPesoLayout.setVerticalGroup(
            jPanelPesoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPesoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelPesoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(txtAtual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelPesoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(txtDesejado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelPesoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(txtHabitual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        jPanelAltura.setBackground(new java.awt.Color(255, 255, 255));
        jPanelAltura.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Altura", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(51, 51, 255)));

        jLabel10.setText("Altura:");

        jLabel11.setText("Joelho:");

        txtAlturaJoelho.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtAlturaJoelhoKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout jPanelAlturaLayout = new javax.swing.GroupLayout(jPanelAltura);
        jPanelAltura.setLayout(jPanelAlturaLayout);
        jPanelAlturaLayout.setHorizontalGroup(
            jPanelAlturaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelAlturaLayout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(jPanelAlturaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel10)
                    .addComponent(jLabel11))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelAlturaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtAlturaJoelho, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtAltura, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jPanelAlturaLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {txtAltura, txtAlturaJoelho});

        jPanelAlturaLayout.setVerticalGroup(
            jPanelAlturaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelAlturaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelAlturaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(txtAltura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelAlturaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(txtAlturaJoelho, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jPanelDiametros.setBackground(new java.awt.Color(255, 255, 255));
        jPanelDiametros.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Diâmetros", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(51, 51, 255)));

        jLabel12.setText("Biestilóide:");

        jLabel13.setText("B. Umeral:");

        jLabel14.setText("B. Femural:");

        javax.swing.GroupLayout jPanelDiametrosLayout = new javax.swing.GroupLayout(jPanelDiametros);
        jPanelDiametros.setLayout(jPanelDiametrosLayout);
        jPanelDiametrosLayout.setHorizontalGroup(
            jPanelDiametrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDiametrosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDiametrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel14, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDiametrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(txtDiametrosBiestiloide, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDiametrosBUmeral, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDiametrosBFemural, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(29, Short.MAX_VALUE))
        );
        jPanelDiametrosLayout.setVerticalGroup(
            jPanelDiametrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDiametrosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDiametrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(txtDiametrosBiestiloide, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDiametrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(txtDiametrosBUmeral, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDiametrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel14)
                    .addComponent(txtDiametrosBFemural, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(24, Short.MAX_VALUE))
        );

        jPanelDobrasCutaneas.setBackground(new java.awt.Color(255, 255, 255));
        jPanelDobrasCutaneas.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Dobras Cutâneas", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(51, 51, 255)));

        jLabel15.setText("Tríceps:");

        jLabel16.setText("Supra-espinal:");

        jLabel17.setText("Panturrilha:");

        jLabel18.setText("Subescapular:");

        jLabel19.setText("Bíceps:");

        jLabel20.setText("Coxa:");

        jLabel21.setText("Supra-ilíaca:");

        jLabel22.setText("Axiliar-medial:");

        jLabel23.setText("Abdome:");

        jLabel24.setText("Torácica:");

        javax.swing.GroupLayout jPanelDobrasCutaneasLayout = new javax.swing.GroupLayout(jPanelDobrasCutaneas);
        jPanelDobrasCutaneas.setLayout(jPanelDobrasCutaneasLayout);
        jPanelDobrasCutaneasLayout.setHorizontalGroup(
            jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDobrasCutaneasLayout.createSequentialGroup()
                .addGroup(jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel19)
                    .addComponent(jLabel22)
                    .addComponent(jLabel21)
                    .addComponent(jLabel20)
                    .addComponent(jLabel18)
                    .addComponent(jLabel17)
                    .addComponent(jLabel16)
                    .addComponent(jLabel15)
                    .addGroup(jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel24)
                        .addComponent(jLabel23)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtDobrasTriceps, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDobrasSupraEspinal, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDobrasPanturrilha, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDobrasSubescapular, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDobrasBiceps, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDobrasCoxa, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDobrasSupraIliaca, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDobrasAxiliarMedial, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDobrasAbdome, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDobrasToracica, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 9, Short.MAX_VALUE))
        );
        jPanelDobrasCutaneasLayout.setVerticalGroup(
            jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDobrasCutaneasLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(txtDobrasTriceps, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel16)
                    .addComponent(txtDobrasSupraEspinal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel17)
                    .addComponent(txtDobrasPanturrilha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel18)
                    .addComponent(txtDobrasSubescapular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel19)
                    .addComponent(txtDobrasBiceps, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel20)
                    .addComponent(txtDobrasCoxa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel21)
                    .addComponent(txtDobrasSupraIliaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel22)
                    .addComponent(txtDobrasAxiliarMedial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel23)
                    .addComponent(txtDobrasAbdome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDobrasCutaneasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel24)
                    .addComponent(txtDobrasToracica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanelPerimetros.setBackground(new java.awt.Color(255, 255, 255));
        jPanelPerimetros.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Perímetros", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(51, 51, 255)));

        jLabel25.setText("Punho:");

        jLabel26.setText("Glúteo máx:");

        jLabel27.setText("Coxa máx:");

        jLabel28.setText("Braço:");

        jLabel29.setText("Abdominal:");

        jLabel30.setText("Panturrilha:");

        jLabel31.setText("Cintura:");

        jLabel32.setText("Tórax:");

        jLabel33.setText("Tornozelo:");

        jLabel34.setText("Quadril:");

        jLabel35.setText("Antebraço:");

        javax.swing.GroupLayout jPanelPerimetrosLayout = new javax.swing.GroupLayout(jPanelPerimetros);
        jPanelPerimetros.setLayout(jPanelPerimetrosLayout);
        jPanelPerimetrosLayout.setHorizontalGroup(
            jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPerimetrosLayout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addGroup(jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel35)
                    .addComponent(jLabel34)
                    .addComponent(jLabel33)
                    .addComponent(jLabel32)
                    .addComponent(jLabel31)
                    .addComponent(jLabel30)
                    .addComponent(jLabel29)
                    .addComponent(jLabel28)
                    .addComponent(jLabel27)
                    .addComponent(jLabel26)
                    .addComponent(jLabel25))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtPerimetroPunho, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPerimetroGluteoMax, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPerimetroCoxaMax, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPerimetroBraco, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPerimetroAbdominal, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPerimetroPanturrilha, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPerimetroCintura, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPerimetroTorax, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPerimetroTornozelo, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPerimetroQuadril, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPerimetroAntebraco, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(24, Short.MAX_VALUE))
        );
        jPanelPerimetrosLayout.setVerticalGroup(
            jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPerimetrosLayout.createSequentialGroup()
                .addGroup(jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel25)
                    .addComponent(txtPerimetroPunho, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel26)
                    .addComponent(txtPerimetroGluteoMax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel27)
                    .addComponent(txtPerimetroCoxaMax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel28)
                    .addComponent(txtPerimetroBraco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel29)
                    .addComponent(txtPerimetroAbdominal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel30)
                    .addComponent(txtPerimetroPanturrilha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel31)
                    .addComponent(txtPerimetroCintura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel32)
                    .addComponent(txtPerimetroTorax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel33)
                    .addComponent(txtPerimetroTornozelo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel34)
                    .addComponent(txtPerimetroQuadril, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPerimetrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel35)
                    .addComponent(txtPerimetroAntebraco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        jPanelBioimpedancia.setBackground(new java.awt.Color(255, 255, 255));
        jPanelBioimpedancia.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Bioimpedância", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(51, 51, 255)));

        jLabel36.setText("Percentual de Gordura(%G):");

        BioPesoMagro.setText("Peso Magro(MCM):");

        jLabel38.setText("Peso Gordo(PG):");

        jLabel39.setText("Peso Muscular(PM):");

        jLabel40.setText("Total de água:");

        jLabel41.setText("Valor energético total (VET):");

        javax.swing.GroupLayout jPanelBioimpedanciaLayout = new javax.swing.GroupLayout(jPanelBioimpedancia);
        jPanelBioimpedancia.setLayout(jPanelBioimpedanciaLayout);
        jPanelBioimpedanciaLayout.setHorizontalGroup(
            jPanelBioimpedanciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBioimpedanciaLayout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addGroup(jPanelBioimpedanciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel36, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(BioPesoMagro, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel38, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel39, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel40, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel41, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanelBioimpedanciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(txtBioPercentualGordura, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBioPesoMagro, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBioPesoGordo, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBioPesoMuscular, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBioTotalAgua, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBioValorEnergeticoTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanelBioimpedanciaLayout.setVerticalGroup(
            jPanelBioimpedanciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBioimpedanciaLayout.createSequentialGroup()
                .addGroup(jPanelBioimpedanciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel36)
                    .addComponent(txtBioPercentualGordura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelBioimpedanciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(BioPesoMagro)
                    .addComponent(txtBioPesoMagro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelBioimpedanciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel38)
                    .addComponent(txtBioPesoGordo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelBioimpedanciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel39)
                    .addComponent(txtBioPesoMuscular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelBioimpedanciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel40)
                    .addComponent(txtBioTotalAgua, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelBioimpedanciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel41)
                    .addComponent(txtBioValorEnergeticoTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 11, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanelDadosLayout = new javax.swing.GroupLayout(jPanelDados);
        jPanelDados.setLayout(jPanelDadosLayout);
        jPanelDadosLayout.setHorizontalGroup(
            jPanelDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator6, javax.swing.GroupLayout.Alignment.TRAILING)
            .addGroup(jPanelDadosLayout.createSequentialGroup()
                .addGroup(jPanelDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDadosLayout.createSequentialGroup()
                        .addGap(29, 29, 29)
                        .addGroup(jPanelDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtNutricionista, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtCrn, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanelDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(txtPaciente, javax.swing.GroupLayout.DEFAULT_SIZE, 224, Short.MAX_VALUE)
                            .addComponent(txtIdade))
                        .addGap(18, 18, 18)
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jDateConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelDadosLayout.createSequentialGroup()
                        .addGap(337, 337, 337)
                        .addComponent(jLabel5))
                    .addGroup(jPanelDadosLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanelDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jPanelPeso, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanelAltura, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanelDiametros, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanelDobrasCutaneas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanelPerimetros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanelBioimpedancia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(53, Short.MAX_VALUE))
        );

        jPanelDadosLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {txtNutricionista, txtPaciente});

        jPanelDadosLayout.setVerticalGroup(
            jPanelDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDadosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanelDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(jLabel3)
                        .addComponent(txtNutricionista, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txtPaciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel6))
                    .addComponent(jDateConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel4)
                    .addComponent(txtCrn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtIdade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator6, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDadosLayout.createSequentialGroup()
                        .addComponent(jPanelPeso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanelAltura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanelDiametros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanelDobrasCutaneas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanelPerimetros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanelBioimpedancia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPainelBotoes, javax.swing.GroupLayout.DEFAULT_SIZE, 934, Short.MAX_VALUE)
            .addComponent(jPanelDados, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPainelBotoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelDados, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoActionPerformed
        novo();
    }//GEN-LAST:event_btnNovoActionPerformed

    private void btnEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarActionPerformed
        editar();
    }//GEN-LAST:event_btnEditarActionPerformed

    private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed
        if(posicao < 0){
            JOptionPane.showMessageDialog(null, "Selecione um perfil para depois excluir.");
        }else{
            int resposta = JOptionPane.showConfirmDialog(null, "Deseja realmente excluir o perfil antropométrico?");
            if(resposta == JOptionPane.OK_OPTION){
                excluir();
            }else{
                cancelar();
            }
        }
        
        
    }//GEN-LAST:event_btnExcluirActionPerformed

    private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed
        salvar();
    }//GEN-LAST:event_btnSalvarActionPerformed

    private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed
        cancelar();
    }//GEN-LAST:event_btnCancelarActionPerformed

    private void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed
        dispose();
    }//GEN-LAST:event_btnSairActionPerformed

    private void btnPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisarActionPerformed
        pesquisar();
    }//GEN-LAST:event_btnPesquisarActionPerformed

    private void txtAlturaJoelhoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtAlturaJoelhoKeyPressed
        
    }//GEN-LAST:event_txtAlturaJoelhoKeyPressed

    private void txtHabitualKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtHabitualKeyPressed
        
    }//GEN-LAST:event_txtHabitualKeyPressed

    private void txtHabitualKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtHabitualKeyReleased
        
    }//GEN-LAST:event_txtHabitualKeyReleased

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel BioPesoMagro;
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnEditar;
    private javax.swing.JButton btnExcluir;
    private javax.swing.JButton btnNovo;
    private javax.swing.JButton btnPesquisar;
    private javax.swing.JButton btnSair;
    private javax.swing.JButton btnSalvar;
    private com.toedter.calendar.JDateChooser jDateConsulta;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPainelBotoes;
    private javax.swing.JPanel jPanelAltura;
    private javax.swing.JPanel jPanelBioimpedancia;
    private javax.swing.JPanel jPanelDados;
    private javax.swing.JPanel jPanelDiametros;
    private javax.swing.JPanel jPanelDobrasCutaneas;
    private javax.swing.JPanel jPanelPerimetros;
    private javax.swing.JPanel jPanelPeso;
    private javax.swing.JSeparator jSeparator6;
    private javax.swing.JTextField txtAltura;
    private javax.swing.JTextField txtAlturaJoelho;
    private javax.swing.JTextField txtAtual;
    private javax.swing.JTextField txtBioPercentualGordura;
    private javax.swing.JTextField txtBioPesoGordo;
    private javax.swing.JTextField txtBioPesoMagro;
    private javax.swing.JTextField txtBioPesoMuscular;
    private javax.swing.JTextField txtBioTotalAgua;
    private javax.swing.JTextField txtBioValorEnergeticoTotal;
    private javax.swing.JTextField txtCrn;
    private javax.swing.JTextField txtDesejado;
    private javax.swing.JTextField txtDiametrosBFemural;
    private javax.swing.JTextField txtDiametrosBUmeral;
    private javax.swing.JTextField txtDiametrosBiestiloide;
    private javax.swing.JTextField txtDobrasAbdome;
    private javax.swing.JTextField txtDobrasAxiliarMedial;
    private javax.swing.JTextField txtDobrasBiceps;
    private javax.swing.JTextField txtDobrasCoxa;
    private javax.swing.JTextField txtDobrasPanturrilha;
    private javax.swing.JTextField txtDobrasSubescapular;
    private javax.swing.JTextField txtDobrasSupraEspinal;
    private javax.swing.JTextField txtDobrasSupraIliaca;
    private javax.swing.JTextField txtDobrasToracica;
    private javax.swing.JTextField txtDobrasTriceps;
    private javax.swing.JTextField txtHabitual;
    private javax.swing.JTextField txtIdade;
    private javax.swing.JTextField txtNutricionista;
    private javax.swing.JTextField txtPaciente;
    private javax.swing.JTextField txtPerimetroAbdominal;
    private javax.swing.JTextField txtPerimetroAntebraco;
    private javax.swing.JTextField txtPerimetroBraco;
    private javax.swing.JTextField txtPerimetroCintura;
    private javax.swing.JTextField txtPerimetroCoxaMax;
    private javax.swing.JTextField txtPerimetroGluteoMax;
    private javax.swing.JTextField txtPerimetroPanturrilha;
    private javax.swing.JTextField txtPerimetroPunho;
    private javax.swing.JTextField txtPerimetroQuadril;
    private javax.swing.JTextField txtPerimetroTorax;
    private javax.swing.JTextField txtPerimetroTornozelo;
    // End of variables declaration//GEN-END:variables
}